#include "./mds_cellverlet_test.h"


void mds_cells_init( const mds_frame *frame, mds_cells *cell, mds_lj_cutoff_data *lj_cutoff )
{
	assert( cell->ix > 0 );
	assert( cell->iy > 0 );
	assert( cell->iz > 0 );
	
	cell->ibox_size = 2.7 * lj_cutoff->sigma;	/*return box_size*/
	
	cell->ibox = ( frame->box.x ) / ( cell->ibox_size );	/*return box number by dimension, because box.x=box.y=box.z*/
	
}


void mds_cells_fill_and_calcul( const mds_frame *frame, mds_vector *r, mds_cells *cell )
{	
	int i,j;
	for(i=0; i<frame->num_particles; i++)
	{	
		cell->ix[i] = floor( r->x / cell->ibox_size );
		cell->iy[i] = floor( r->y / cell->ibox_size );  /*box index*/
		cell->iz[i] = floor( r->z / cell->ibox_size );
		
		/*cell->index[i] = cells [cell->ix][cell->iy][cell->iz];*/ 
		
		for(j=0 ;j<frame->num_particles; j++)
		{
			if((cell->ix[i]=cell->ix[j] || cell->ix[i]=cell->ix[j]+1 || cell->ix[i]=cell->ix[j]-1) 
			&& (cell->iy[i]=cell->iy[j] || cell->iy[i]=cell->iy[j]+1 || cell->iy[i]=cell->iy[j]-1)
			&& (cell->iz[i]=cell->iz[j] || cell->iz[i]=cell->iz[j]+1 || cell->iz[i]=cell->iz[j]-1))
			{
				
			}
		}
	}
}


/*cells [little_box->ix][little_box->iy][little_box->iz] += 1;*/
